/**
 * @author Yuliy Khorolinskyy
 *
 * Reaktionsspiel data
 *
 * 02.01.2012
 */
package data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Yuliy
 *
 */
public class OptionsEntry extends Entry {

	private PossibleOption defOption;
	final private List<PossibleOption> options;
	public OptionsEntry(ArrayList<PossibleOption> options) {
		this.options = options;
	}

	public OptionsEntry(ArrayList<PossibleOption> options,PossibleOption defOption) {
		this.options = options;
		this.defOption = defOption;
	}

	/* (non-Javadoc)
	 * @see data.Entry#getEntryValue(int)
	 */
	@Override
	public Object getEntryValue(int key) {
		if(key == 0)return defOption;
		else{ 
			try {
				return options.get(key + 1);
			} catch (IndexOutOfBoundsException e) {
				return null;
			}
		}
	}

	public PossibleOption getDefOption() {
		return defOption;
	}

	public void setDefOption(PossibleOption defOption) {
		this.defOption = defOption;
	}

	public List<PossibleOption> getOptions() {
		return options;
	}
	
}
